;; Sri Ganeshji : Sri Balaji : Sri Pitreshwarji : Sri Durgaji : Sri Venkateshwara

/*
Objective(s) - 
-	The objective of this program is to demonstrate the usage of Rule Set in the simplest way

Syntax -

[Rule Set: <RuleSetName>]
     
    Rule	: <RuleName> : <LogicalExpression>[:<LogicalValue>]
	
where,
	Rule name 			: This is developer defined
	LogicalExpression	: Any expression to be evaluted in context of requestor / source / target object being passed
	Logical Value 		: A constant value providing BreakOn condition. This is an optional parameter. 
						 If this parameter is not specified it will inherit the BreakOn attribute value

Last modification - 
-	Created on 28/11/2016

*/

[Report: TSPL Smp BreakOnYes]
		
	Form		: TSPL Smp BreakOnYes
	Title		: "BreakOn : Yes"

[Form: TSPL Smp BreakOnYes]
	
	Use			: TSPL SMP Illustration
	Local		: Field	: FormSubTitle		: Info		: "Illustration for attribute BreakOn with value Yes"
	Local		: Field	: TSPL Smp Purpose	: Info		: "     Attribute Break On is a Single attribute at Rule Set definition " +
			+ "While evaluating each rule, if a rule's result is True, the evaluation flow will break and no further rules will " +
			+ "be evaluated and are defaulted to 'No'."
	Local		: Field	: TSPL Smp Syntax	: Info		: "[Rule Set : <RuleName>]" + 
			+ $$NewLine + "         Breakon : <LogicalValue>" 
	Part		: TSPL Smp SimpleRule
	Local		: Part		: TSPL Smp SimpleRule	: Delete	: Repeat
	Local		: Part		: TSPL Smp SimpleRule	: Add		: Repeat	: TSPL Smp SimpleRuleB	: TSPL Smp BreakOnYes
			
			
[Collection: TSPL Smp BreakOnYes]
 
    Source Collection   : Ledger
    Fetch               : Name, Parent, IsBillWiseOn, OpeningBalance, LedgerContact, LedgerPhone
;; The same code could be written with multiple Compute Var. With Rule set introduction
;; we have written just one compute var and one compute for final result.
    Compute Var         : cvEvalRSValue     : FlagSet    : $$EvaluateRuleSet:TSPLSmpBreakOnYes
	Compute             : EvalRSValue       : ##cvEvalRSValue
 
[Rule Set: TSPL Smp BreakOnYes]
     
	Rule        : R1    : @IsLedOfGrpDebtors
    Rule        : R2    : $IsBillWiseOn

    LocalFormula: IsLedOfGrpDebtors      : ($$IsLedOfGrp:$Name:$$GroupSundryDebtors)
	
	Break On	: Yes
	
;; End of file